package com.mytx.notify;

import com.mytx.notify.config.ServerLauncherImpl;
import com.mytx.notify.config.SpringUtils;
import net.openmob.mobileimsdk.server.ServerLauncher;
import net.openmob.mobileimsdk.server.event.ServerEventListener;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableEurekaClient
@EnableTransactionManagement
@MapperScan(basePackages = "com.mytx.mapper")
public class MytxNotifyApplication {


    public static void main(String[] args) throws Exception {
        SpringApplication.run(MytxNotifyApplication.class, args);
//        ServerLauncher serverLauncher = SpringUtils.getBean("serverLauncher");
//        serverLauncher.startup();
//        // 加一个钩子，确保在JVM退出时释放netty的资源
//        Runtime.getRuntime().addShutdownHook(new Thread() {
//            @Override
//            public void run() {
//                serverLauncher.shutdown();
//            }
//        });
    }
}
